[iPhone] dyld: Library not loaded - When app run from the command line

Posted by user142764 on Stack Overflow See other posts from Stack Overflow or by user142764
Published on 2010-03-18T17:35:48Z Indexed on 2010/03/18 17:51 UTC
Read the original article Hit count: 534

Filed under:
|

Hi,

I face some difficulties when adding a framework to my project when i run an iPhone app from the command line. My final goal is to run applications tests from an automated build process.

When i run my app from xCode :

I add a "Copy File" build phase to my target and everything goes fine. The copy is set to $(BUILT_PRODUCTS_DIR) as "Absolute path"

When i run my app from the terminal (using iphonesim project) i get this error :

 dyld: Library not loaded: @rpath/OCMock.framework/Versions/A/OCMock

 UIKitApplication:indemnisation[0xb894][26380]     Referenced from: /Users/Admin/Library/Application Support/iPhone Simulator/User/Applications/CD5729B5-A674-49B2-91F6-AD398094B6F8/indemINT.app/indemINT

What i dont understand is that the copy build phase just copies the framework files in the same directory that the app.

When i run the app from the command line the framework files are already in the same directory. Does anyone knows why it doesn't work ?

I've also tried to add the OCMock.framework in the following directories (without success) :

 /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.0.sdk/System/Library

 /Library/Frameworks

 /Users/Admin/Library/Application Support/iPhone Simulator/User/Applications/CD5729B5-A674-49B2-91F6-AD398094B6F8

Thanks in advance, Vincent.

© Stack Overflow or respective owner

Related posts about iphone

Related posts about dyld